
<!doctype html>
<html class="no-js" lang="">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="x-ua-compatible" content="ie=edge">
    <title>后台管理页面</title>
    <meta name="description" content="">
    <meta name="viewport" content="width=device-width, initial-scale=1">

    <link rel="apple-touch-icon" href="apple-touch-icon.png">
    <!-- Place favicon.ico in the root directory -->

    <link rel="stylesheet" type="text/css" href="../css/reset.css">
</head>

<body>
    <div class="warpBg">
        <div class="login">
            <div class="loginBg"></div>
            <div class="loginInfo">
                <input type="text" class="name" name="" placeholder="账号">
                <input type="text" class="password" name="" placeholder="密码">
                <button class="loginClick">登录</button>   
            </div>
        </div>
        <header class="header">
            <p class="title">商城管理后台</p>
            <span><i></i>退出登录</span>
        </header>
        <section class="main">
            <div class="mainLeft">
                <div class="mainItim">
                    <p class="mainTitle">商品管理</p>
                    <ul>
                        <li><a href="component/prcList.html" target="iframe">商品列表</a></li>
                        <li><a href="component/prcAddList.html" target="iframe" href="">添加商品</a></li>
                        <li><a href="component/prcClass.html" target="iframe" href="">商品类别</a></li>
                        <li><a href="component/prcAddClass.html" target="iframe" href="">添加商品类别</a></li>
                    </ul>    
                </div>
                <div class="mainItim">
                    <p class="mainTitle">订单管理</p>
                    <ul>
                        <li><a href="component/order.html" target="iframe">订单列表</a></li>
                    </ul>    
                </div>
                <div class="mainItim">
                    <p class="mainTitle">广告管理</p>
                    <ul>
                        <li><a href="component/banner.html" target="iframe">广告列表</a></li>
                        <li><a href="component/bannerAdd.html" target="iframe" href="">添加广告</a></li>
                    </ul>    
                </div>
                <div class="mainItim">
                    <p class="mainTitle">卡卷管理</p>
                    <ul>
                        <li><a href="component/cardList.html" target="iframe">卡卷列表</a></li>
                        <li><a href="component/cardAdd.html" target="iframe" href="">添加卡卷</a></li>
                    </ul>    
                </div>
                <div class="mainItim">
                    <p class="mainTitle">会员管理</p>
                    <ul>
                        <li><a href="component/people.html" target="iframe">会员列表</a></li>
                    </ul>    
                </div>
                <div class="mainItim">
                    <p class="mainTitle">抽奖管理</p>
                    <ul>
                        <li><a href="component/luckList.html" target="iframe">奖品列表</a></li>
                        <li><a href="component/luckAdd.html" target="iframe">添加奖品</a></li>
                        <li><a href="component/luckEt.html" target="iframe">抽奖信息设置</a></li>
                    </ul>    
                </div>
            </div>
            <div class="mainRight">
                <iframe class="iframe" name="iframe" src="component/index.html"></iframe>
            </div>
        </section>
    </div>
</body>
<script src="../js/jquery.js"></script>
<script src="../js/jquery.cookie.js"></script>
<script type="text/javascript">
    $(function(){
        
        var admintoken=$.cookie('admintoken');
        if(admintoken!='null'&&admintoken!=null){
            $('.login').css('display','none')
        }else{
            $('.login').css('display','block')
        };

        //选中当前栏目
        $('.mainItim li').click(function(){
            $('.mainItim li').removeClass('active');
            $(this).addClass('active');
        })
        
        //退出登录
        $('.header span').click(function(){
            $.cookie('admintoken',null);
            window.location.reload();
        })

        //登录
        $('.loginClick').click(function(){
            var name=$('.name').val();
            var password=$('.password').val();

                var data={
                            "grant_type": "password",
                            "client_id": "game-admin",
                            "client_secret": "0a0e2b7c0f223ff235810cbdc70f1ddd",
                            "scope": "game_admin",
                            "username": name,
                            "password": password
                        };
                $.ajax({
                    type: 'POST',
                    url:'http://www.math80.com/token',
                    data:data,
                    success:function(data){
                        $.cookie('admintoken',data.data.access_token, { expires: 0.1 });
                        $('.login').css('display','none')
                    }
                })
                $('.name').val('');
                $('.password').val('');
            });
            

    })

</script>
</html>